import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import index from '../views/index.vue'
import indexshouye from '../views/indexshouye.vue'
import indexstongcheng from '../views/indexstongcheng.vue'
import indexzhuanti from '../views/indexzhuanti.vue'
import indexshangjia from '../views/indexshangjia.vue'
import indexshangpinsousuo from '../views/indexshangpinsousuo.vue'
import indexshangpinfenlie from '../views/indexshangpinfenlie.vue'
import gouwuche from '../views/gouwuche.vue'
import gouwucheliebiao from '../views/gouwucheliebiao.vue'
import gouwudingdan from '../views/gouwudingdan.vue'
import gouwuchetijiao from '../views/gouwuchetijiao.vue'
import chongzhi from '../views/chongzhi.vue'
import goodsxiangqing from '../views/goodsxiangqing.vue'




import myself from '../views1/myself.vue'
import myaccount from '../views1/xl-myaccount.vue'
import useropinion from '../views1/xl-useropinion.vue'
import mymessage from '../views1/xl-mymessage.vue'
import refillcard from '../views1/xl-refillCard.vue'
import changepassword from '../views1/xl-changePassword.vue'
// import changepassword from '../views1/xl-passwordchange2.vue'
import mynew from '../views1/xl-mynew.vue'
import myorder from '../views1/xl-myorder.vue'
import orderdetail from '../views1/xl-orderdetail.vue'
import orderevaluate from '../views1/xl-orderevaluate.vue'
import myintegral from '../views1/xl-myintegral.vue'
import integerorder from '../views1/xl-integralorder.vue'
import mypurse from '../views1/xl-mypurse.vue'
import addermes from '../views1/xl-addermes.vue'
import addnewaddress from '../views1/xl-addnewaddress.vue'
import mycollect from '../views1/xl-mycollect.vue'
import mybrowse from '../views1/xl-mybrowse.vue'
import changephone1 from '../views1/xl-changephone1.vue'
import changephone2 from '../views1/xl-changephone2.vue'
import changephone3 from '../views1/xl-changephone3.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: Home
  },
  {
    path: '/index',
    component: index,
    children: [
      { path: '', redirect: 'indexshouye' },
      { path: 'indexshouye', component: indexshouye },
      { path: 'indexstongcheng', component: indexstongcheng },
      { path: 'indexzhuanti', component: indexzhuanti },
      { path: 'indexshangjia/:id', component: indexshangjia },
      { path: 'indexshangpinfenlie', component: indexshangpinfenlie },
      { path: 'indexshangpinsousuo',name: 'indexshangpinsousuo', component: indexshangpinsousuo },
      { path: 'goodsxiangqing/:id', component: goodsxiangqing },
      { path: 'myself',
        component: myself, children: [
          { path: '', redirect: 'myaccount' },
          { path: 'myaccount', component: myaccount },
          { path: 'myaccount/refillcard', component: refillcard },
          { path: 'useropinion', component: useropinion },
          { path: 'mymessage', component: mymessage },
          { path: 'mymessage/changephone1', component: changephone1 },
          { path: 'mymessage/changephone2', component: changephone2 },
          { path: 'mymessage/changephone3', component: changephone3 },
          { path: 'changepassword', component: changepassword },
          { path: 'mynew', component: mynew },
          { path: 'myorder', component: myorder },
          { path: 'myorder/orderdetail', component: orderdetail },
          { path: 'myorder/orderevaluate', component: orderevaluate },
          { path: 'myintegral', component: myintegral },
          { path: 'integerorder', component: integerorder },
          { path: 'mypurse', component: mypurse },
          { path: 'addermes', component: addermes },
          { path: 'addermes/addnewaddress', component: addnewaddress },
          { path: 'mycollect', component: mycollect },
          { path: 'mybrowse', component: mybrowse },
        ],
      },
    ]
  },
  { path: '/chongzhi',name:"chongzhi", component: chongzhi },
  {
    path: '/gouwuche',
    component: gouwuche,
    children: [
      { path: '', redirect: 'gouwucheliebiao' },
      { path: 'gouwucheliebiao', component: gouwucheliebiao },
      // 当路由是 /user/:id/profile 值时, 将 UserProfile 显示在 User 组件中的 <router-view> 中
      { path: 'gouwudingdan', component: gouwudingdan },
      // /user/:id/posts
      { path: 'gouwuchetijiao', component: gouwuchetijiao },
    ]
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
